<template>
	<view>
		<view class="pa-3" v-if="articleData" selectable="true">
			<view class="titleSize">{{articleData.title}}</view>
			<view class="mb-2"><text class="font-12 color999">{{articleData.createTime|timetrans}}</text></view>
			<u-parse :selectable="true" :content='articleData.content' :tagStyle="style" style=""></u-parse>
		</view>
	</view>
</template>

<script>
	import { getServiceCommitment , getSecurityAgreement} from "@/api/order.js";
	export default {
		data() {
			return {
				articleData:null,
				style: {
					// 字符串的形式
					img: ' max-width: 100%; width:auto; height: 100%;vertical-align: middle;',
					span:'text-wrap:wrap !important;'
				}
			};
		},
		onLoad(options) {
			if(options.title){
				uni.setNavigationBarTitle({
					title: options.title
				});
			}
		  if (options.type==1) {
			   this.getServiceCheng();
		  }
		
		},
		methods:{
			// 服务成若
			async getServiceCheng(id) {
			  try {
			    const res = await getServiceCommitment({});
			    this.articleData = res.data;
				 uni.setNavigationBarTitle({
				 	title: res.data.summary
				 });
			  } catch (err) {
			    console.log(err);
			  }
			},
			// 担保协议
			async getService(id) {
			  try {
			    const res = await getSecurityAgreement({});
			    this.articleData = res.data;
			  } catch (err) {
			    console.log(err);
			  }
			},
		}
	}
</script>

<style lang="scss">
.pa-3{
	padding: 24rpx;
}
.titleSize{
	font-size: 32rpx;
}
.mb-2{
	margin-bottom: 8rpx;
}
.font-12{
	font-size: 24rpx;
}
 .color999{
	 color: #999;
 }
</style>
